package com.weiyuwqj.api.util;

import com.weiyuwqj.api.exception.CrowdException;

/**
 * Created by Administrator on 2017/1/19.
 */
public class MyAssertUtils {

    /**
     * 是否为真
     * @param flag              条件
     * @param msg               提示信息
     */
    public static void isTrue(boolean flag,String msg){
        if(!flag){
            throw new CrowdException(msg);
        }
    }

    /**
     * 是否为空
     * @param obj       校验的对象
     * @param msg       如果为空的提示信息
     */
    public static void isNullOrEmpty(Object obj,String msg){
        if(obj==null || obj ==""){
            throw new CrowdException(msg);
        }
    }

}
